<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<input type="hidden" id="id" name="id">
			<div class='form-group'>
				<label class='col-md-2 control-label'>sysUserId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='sysUserId' type='text' name='sysUserId' id='sysUserId' data-bv-notempty='true' data-bv-notempty-message='sysUserId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationType</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationType' type='text' name='operationType' id='operationType' data-bv-notempty='true' data-bv-notempty-message='operationType 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>mallType</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='mallType' type='text' name='mallType' id='mallType' data-bv-notempty='true' data-bv-notempty-message='mallType 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>mallId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='mallId' type='text' name='mallId' id='mallId' data-bv-notempty='true' data-bv-notempty-message='mallId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationSource</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationSource' type='text' name='operationSource' id='operationSource' data-bv-notempty='true' data-bv-notempty-message='operationSource 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationTime</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationTime' type='text' name='operationTime' id='operationTime' data-bv-notempty='true' data-bv-notempty-message='operationTime 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationIp</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationIp' type='text' name='operationIp' id='operationIp' data-bv-notempty='true' data-bv-notempty-message='operationIp 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationNote</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationNote' type='text' name='operationNote' id='operationNote' data-bv-notempty='true' data-bv-notempty-message='operationNote 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>operationRemark</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='operationRemark' type='text' name='operationRemark' id='operationRemark' data-bv-notempty='true' data-bv-notempty-message='operationRemark 不能为空'>
				</div>
			</div>



			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='tswSysOperationSourceList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="update()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		initData();
		
		function initData(){
			var id = getUrlParam("id");
			if(id != ""){
				$.ajax({
					type : 'get',
					url : '/tswSysOperationSources/'+id,
					async : false,
					success : function(data) {
						$('#id').val(data.id);
						$('#sysUserId').val(data.sysUserId);
						$('#operationType').val(data.operationType);
						$('#mallType').val(data.mallType);
						$('#mallId').val(data.mallId);
						$('#operationSource').val(data.operationSource);
						$('#operationTime').val(data.operationTime);
						$('#operationIp').val(data.operationIp);
						$('#operationNote').val(data.operationNote);
						$('#operationRemark').val(data.operationRemark);

					}
				});
			}
		}

		function update() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'put',
				url : '/tswSysOperationSources',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("修改成功", {shift: -1, time: 1000}, function(){
                        location.href = "tswSysOperationSourceList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
